package com.lkd.utils;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DateDay {
    public static List<LocalDate> getDateDay(String start, String end) {
        LocalDate startTime = LocalDate.parse(start, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        LocalDate endTime = LocalDate.parse(end, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        LocalDate newstart = null;
        LocalDate newend;
        ArrayList<LocalDate> date = new ArrayList<>();
        for (long i = 0; i < (endTime.toEpochDay() - startTime.toEpochDay()) + 1; i++) {
            if (i == 0) newstart = startTime;

            newend = startTime.plusDays(i + 1);

            date.add(newstart);

            newstart = newend;
        }
/*        HashMap<String, List> map = new HashMap<>();
        map.put("xAxis", date);*/
        //map.put("series",money);
        return date;
    }
}
